<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<div class='col-lg-4 col-lg-offset-4'>

    <h1><i class='fa fa-key'></i> Add Permission</h1>
    <br>

    {{ Form::open(array('url' => 'admin/permissions')) }}

    <div class="form-group">
        {{ Form::label('name', '权限名') }}
        {{ Form::text('name', '', array('class' => 'form-control')) }}
    </div><br> <div class="form-group">
        {{ Form::label('title', '标题') }}
        {{ Form::text('title', '', array('class' => 'form-control')) }}
    </div><br> <div class="form-group">
        {{ Form::label('p_id', '父级权限') }}
        {{ Form::text('p_id','', array('class' => 'form-control')) }}
    </div><br> <div class="form-group">
        {{ Form::label('level', '等级') }}
        {{ Form::text('level', '', array('class' => 'form-control')) }}
    </div><br> <div class="form-group">
        {{ Form::label('is_show', '是否显示') }}
        {{ Form::text('is_show', '', array('class' => 'form-control')) }}
    </div><br> <div class="form-group">
        {{ Form::label('url', '权限链接') }}
        {{ Form::text('url', '', array('class' => 'form-control')) }}
    </div><br>
    @if(!$roles->isEmpty()) //If no roles exist yet
    <h4>Assign Permission to Roles</h4>

    @foreach ($roles as $role)
        {{ Form::checkbox('roles[]',  $role->id ) }}
        {{ Form::label($role->name, ucfirst($role->name)) }}<br>

    @endforeach
    @endif
    <br>
    {{ Form::submit('Add', array('class' => 'btn btn-primary')) }}

    {{ Form::close() }}

</div>
</body>
</html>